package cate.game.play.skill.passive.boss;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.TimeActionCtx;
import cate.game.play.proce.move.AppendMove;
import cate.game.play.proce.move.AppendMoveHandler;
import cate.game.play.proce.move.MoveCtx;
import cate.game.play.proce.turn.TurnCtx;
import cate.game.play.skill.Skill;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 每当手下出手时，蚩尤会进行一次追击，并为自己附加[混沌印记]无冷却时间
 */
public class 天魔咒术PH extends PassiveHandler implements AppendMoveHandler {

	private int 追加技能;

	//追加技能=??
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		追加技能 = args.getInt("追加技能", 0);
	}

	@Override
	public void onMoveDone(MoveCtx move, TimeActionCtx action) {
		if (move.getActor().getPid() == skill.owner.getPid()) {
			return;
		}
		if (move.getActor().getTeam() != skill.owner.getTeam()) {
			return;
		}
		Skill appendSkill = action.getCfg().skill.buildById(skill.owner, 追加技能);
		if (appendSkill == null) {
			return;
		}
		move.getTurn().addAppend(new AppendMove(skill.owner, appendSkill, this));
	}

	@Override
	public boolean inValid(TurnCtx turn, AppendMove appendMove) {
		return false;
	}

	@Override
	public void beforeAppendMove(TurnCtx turn, AppendMove appendMove) {

	}

	@Override
	public void afterAppendMove(TurnCtx turn, AppendMove appendMove) {

	}

	@Override
	public void onAppendMoveFail(TurnCtx turn, AppendMove appendMove) {

	}
}
